package com.weixin.service.impl;

import java.util.Date;
import java.util.List;

import com.weixin.bean.DinnerTable;
import com.weixin.bean.TableStatus;
import com.weixin.dao.DinnerTableDao;
import com.weixin.dao.impl.DinnerTableDaoimpl;
import com.weixin.service.DinnerTableService;

public class DinnerTableServiceimpl implements DinnerTableService {
	
	private DinnerTableDao dinnerTableDao=new DinnerTableDaoimpl();

	@Override
	public List<DinnerTable> findNoUseTable() {
		// TODO Auto-generated method stub
		return dinnerTableDao.findByStatus(TableStatus.Free);
	}

	@Override
	public DinnerTable findById(int id) {
		// TODO Auto-generated method stub
		return dinnerTableDao.findById(id);
	}

	@Override
	public List<DinnerTable> getAllByPage(int offset, int limit) {
		// TODO Auto-generated method stub
		return dinnerTableDao.getAllByPage(offset, limit);
	}

	@Override
	public int getTotal() {
		// TODO Auto-generated method stub
		return dinnerTableDao.selectCount();
	}

	@Override
	public List<DinnerTable> getAllByPage2(int pageNum, int pageSize) {
		// TODO Auto-generated method stub
		return dinnerTableDao.getAllByPage2(pageNum, pageSize);
	}

	@Override
	public List<DinnerTable> getAllByPage1() {
		// TODO Auto-generated method stub
		return dinnerTableDao.getAllByPage1();
	}

	@Override
	public boolean update(int id, int tableStatus, Date orderDate) {
		// TODO Auto-generated method stub
		return dinnerTableDao.update(id, tableStatus, orderDate);
	}

	@Override
	public boolean delete(int id) {
		// TODO Auto-generated method stub
		return dinnerTableDao.delete(id);
	}

	@Override
	public boolean save(DinnerTable dinnerTable) {
		// TODO Auto-generated method stub
		return dinnerTableDao.save(dinnerTable);
	}

	 

}
